package com.sunday.volunteer.admin.adapter.viewpager;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by Administrator on 2016/10/13.
 */
public class BaseFragmentPageAdapter extends FragmentPagerAdapter {

    private String[] type;
    private List<Fragment> list;

    public BaseFragmentPageAdapter(FragmentManager fm, List<Fragment> list, String[] type) {
        super(fm);
        this.list = list;
        this.type = type;
    }

    @Override
    public Fragment getItem(int position) {
        return list.get(position);
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return type[position];
    }
}
